package com.chouxiaozi.dubboclient;

import com.chouxiaozi.IHelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    /**
     * loadbalance 负载均衡
     * cluster = "" 容错
     * mock = "" 降级
     */
    @DubboReference(loadbalance = "random")
    IHelloService helloService;

    @GetMapping("/hello")
    public String hello(){
        return helloService.sayHello("hello!");
    }


}
